/*
 * uart.h
 *
 *  Created on: 28 Jul 2011
 *      Author: bwm23
 */

#ifndef UART_H_
#define UART_H_

#include <altera_avalon_uart.h>
#include <altera_avalon_uart_fd.h>
#include <altera_avalon_uart_regs.h>

#include <fcntl.h>

#include "sys/alt_dev.h"
#include "sys/alt_irq.h"
#include "sys/ioctl.h"
#include "sys/alt_errno.h"
#include "alt_types.h"



/*
 * Externally referenced routines
 */
extern int altera_avalon_uart_read(altera_avalon_uart_state* sp, char* ptr, int len, int flags);
extern int altera_avalon_uart_write(altera_avalon_uart_state* sp, const char* ptr, int len, int flags);

extern int read_uart(unsigned int base, char* buffer);
extern int write_uart(unsigned int base, const char* buffer, int len);
extern int getTxLength(char* string);
extern int sendBT(const char tx, char* rx);

#endif /* UART_H_ */
